﻿using System;
using System.Collections.Generic;
using System.Text;
using Abp.AutoMapper;
using FwProject.Core.FactoryInfo;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using FwProject.Core.SettlementInfoModel;
using FwProject.Authorization.Users;
using Abp.Domain.Entities.Auditing;
using Abp.Domain.Entities;
using System.Linq;

namespace FwProject.Settlement.Dto
{
    public class SettlementAppToBInfoDto : Entity<Guid>, ICreationAudited
    {
        /// <summary>
        /// 餐厅
        /// </summary>
        /// <value>The restaurantid.</value>
        [Display(Name = "餐厅编号")]
        public Guid Restaurantid { get; set; }
        [Display(Name = "餐厅")]
        public RestaurantInfoModel RestaurantInfoModel { get; set; }

        [Display(Name = "结账单号")]
        public string CreationNumber { get; set; }
        /// <summary>
        /// 应收金额
        /// </summary>
        /// <value>The totalprice.</value>
        [Display(Name = "应收金额")]
        public decimal Totalprice { get; set; } = 0;
        /// <summary>
        /// 优惠金额
        /// </summary>
        /// <value>The discountprice.</value>
        [Display(Name = "优惠金额")]
        public decimal Discountprice { get; set; } = 0;
        /// <summary>
        /// 实际金额
        /// </summary>
        /// <value>The actualprice.</value>

        [Display(Name = "实际金额")]
        public decimal Actualprice { get; set; } = 0;

        [Display(Name = "实际收款金额")]
        public decimal ReceivedPrice { get; set; } = 0;

        [Display(Name = "实际优惠金额")]
        public decimal ReceivedDiscount { get; set; } = 0;

        [Display(Name = "实际使用预收金额")]
        public decimal UsePrePayment { get; set; } = 0;

        [Display(Name = "支付确认状态")]
        public RestaurantPayStatus RestaurantPayStatus { get; set; }
        /// <summary>
        /// 收款司机
        /// </summary>
        /// <value>The employee driverid.</value>
        [Display(Name = "司机编号")]
        public long? EmployeeDriverid { get; set; }
        [Display(Name = "收款司机")]
        public UserModel EmployeeDriverDao { get; set; }

        /// <summary>
        /// 配送时间 2018-01-01-2018--01-31 当月
        /// 2018-01-01 当日
        /// </summary>
        public string DeliveryDate { get; set; }
        /// <summary>
        /// 默认定期结算特殊情况按照日结系统默认自动生成数据。
        /// </summary>
        public FwProject.Core.Restaurant.BalanceWayEnum BalanceWayEnum { get; set; } = FwProject.Core.Restaurant.BalanceWayEnum.定期结算;

        /// <summary>
        /// 收据备注
        /// </summary>
        public string RemarksConten { get; set; }

        public long? CreatorUserId { get; set; }
        public DateTime CreationTime { get; set; }

        public IQueryable<DistributionByTypeNumber> DistributionByTypeNumber { get; set; }

    }

    public class DistributionByTypeNumber {

        public Guid Restaurantid { get; set; }

        public Guid SettlementId { get; set; }
        public string TypeNumberName { get; set; }
             /// <summary>
            /// 本次配送套数
            /// </summary>
          /// <value>The distributioncount.</value>
        [Display(Name = "本次配送套数")]
        public int Distributioncount { get; set; } = 0;
        /// <summary>
        /// 回收
        /// </summary>
        /// <value>The recoverycount.</value>
        [Display(Name = "回收")]
        public int Recoverycount { get; set; } = 0;
        /// <summary>
        /// 换货
        /// </summary>
        /// <value>The exchangegoodscount.</value>
        [Display(Name = "换货")]
        public int Exchangegoodscount { get; set; } = 0;
        /// <summary>
        /// 折损
        /// </summary>
        /// <value>The damagecount.</value>
        [Display(Name = "折损")]
        public int Damagecount { get; set; } = 0;
        /// <summary>
        /// 赠送
        /// </summary>
        /// <value>The givecount.</value>
        [Display(Name = "赠送")]
        public int Givecount { get; set; } = 0;
        /// <summary>
        /// 退箱
        /// </summary>
        /// <value>The backboxcount.</value>
        [Display(Name = "退箱")]
        public int Backboxcount { get; set; } = 0;
        /// <summary>
        /// 退数
        /// </summary>
        /// <value>The backnumbercount.</value>
        [Display(Name = "退数")]
        public int Backnumbercount { get; set; } = 0;
}
   
}
